From 67bf26f0eed08a55348393199a114a191ff0020b Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 22 Dec 2008 20:20:04 +0000 Subject: [PATCH] (shadow-copy-file): Handle buffer-swapped-with. --- lisp/shadowfile.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/shadowfile.el b/lisp/shadowfile.el index 751a33d260d..ece12c367e1 100644 --- a/lisp/shadowfile.el +++ b/lisp/shadowfile.el @@ -574,8 +574,14 @@ site." (when buffer (set-buffer buffer) (condition-case i - (progn - (write-region nil nil to) + (progn + (if buffer-swapped-with + (progn + (buffer-swap-text buffer-swapped-with) + (unwind-protect + (write-region nil nil to) + (buffer-swap-text buffer-swapped-with))) + (write-region nil nil to)) (shadow-remove-from-todo s)) (error (message "Shadow %s not updated!" (cdr s))))))) -- 2.30.2